home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3808 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Funcion STRCMP no lexicographical
  5. Date: 30 Jan 1996 07:22:15 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4eld37INNbt4@keats.ugrad.cs.ubc.ca>
  8. References: <4e8e3h$k0s@serra.unipi.it>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <4e8e3h$k0s@serra.unipi.it>,
  12. Luca Fiorani  <fioranil@ilc.pi.cnr.it> wrote:
  13. >Developing GCC/G++ programs under sparc-sun-sunOS4.1.3 , i need simply to
  14. >compare arrays that may include characters>127(dec.).
  15. >STRCMP or MEMCMP do this lexicographically, that is what i don't want to do.
  16. >Are there other functions that compares 2 arrays NOT lexicografically ?
  17. >(the matter is that lexicographically chars>127 are BEFORE chars<=127)
  18.  
  19. I'm not sure what you mean by "lexicographic". It seems to be a consequence of
  20. using signed comparisons on eight-bit quantities. Lexicographic doesn't
  21. necessarily mean "ordered by ASCII codes".
  22.  
  23. Rewrite strcmp() so that it uses unsigned arithmetic.
  24. -- 
  25.  
  26.